package chapter14;

public class Square extends GeometricObject implements Colorable {
	/*编程题14.3*/
	private double length;
	
	public Square(){
		this(1.0);
	}
	
	public Square(double length){
		this.length = length;
	}
	
	public double getLength(){
		return length;
	}
	
	public void setLength(double length){
		this.length = length;
	}

	public void howToColor() {
		System.out.println("Color all four sides");
	}

	public double getArea() {
		return length * length;
	}

	public double getPerimeter() {
		return 4 * length;
	}

}
